Skip to content

feat: add support for NodeJS Azure Functions project type#174

Open
martindandanell wants to merge 1 commit intosyncable-dev:mainfrom
martindandanell:feature/azure-function-node-js
Open

feat: add support for NodeJS Azure Functions project type#174
martindandanell wants to merge 1 commit intosyncable-dev:mainfrom
martindandanell:feature/azure-function-node-js

Conversation

@martindandanell
Copy link
Copy Markdown

@martindandanell martindandanell commented Oct 17, 2025

Changes

  • Added support for Azure Functions project type (for JavaScript language: NodeJS, TS) as per issue: Support for Azure Functions using NodeJS runtime #175
  • Added FunctionApp project type
  • Changed source file identification to check for complete path segment names to avoid false positives on partial names (See nextjs_does_not_detect_with_application_folder as an example)

Implementation details

  • Projects identified as Azure Functions are mapped to the new FunctionApp project type and the category to Service (MS defines an Azure Functions app as a "Serverless computing service")

Example output

🔍 Analyzing project: /Users/martindandanell/Projects/EngageRx/notetaker-be-pilot-az/
================================================================================

📊 PROJECT ANALYSIS RESULTS
================================================================================

🏗️  Architecture: Single Project

🌐 Technology Summary:
   Languages: TypeScript
   Frameworks: Azure Functions

📁 Project Details:
================================================================================

🚀 1. notetaker-be-pilot-az (Service)
   🌐 Languages:
      • TypeScript (confidence: 92.5%)
   🚀 Technologies:

🛠️  Technology Stack:
   🎯 PRIMARY: Azure Functions (confidence: 95.0%)
      Architecture driver for this project

   🖥️  Backend Frameworks:
      • Azure Functions (confidence: 95.0%)
   📍 Entry Points (1):
      1. File: /Users/martindandanell/Projects/EngageRx/notetaker-be-pilot-az/dist/src/{index.js,functions/*.js}
         Command: node dist/src/{index.js,functions/*.js}
   🔨 Build Scripts (12):
      Default scripts:
        • start: concurrently "npm run watch" "npm run func"
          Start the application
      Other scripts:
        • azurite: azurite
        • build: tsc
          Build the application
        • clean: rimraf dist
        • format: prettier --write "src/**/*.ts"
          Format code
        • format:check: prettier --check "src/**/*.ts"
        • func: func start
        • lint: eslint . --ext .ts
          Run linter
        • lint:fix: eslint . --ext .ts --fix
        • prestart: npm run clean && npm run build
        • test: echo "No tests yet..."
          Run tests
        • watch: tsc --watch
   📦 Dependencies (17):
      • prettier (dev) v^3.6.2
      • @typescript-eslint/eslint-plugin (dev) v^8.40.0
      • ai v^4.3.16
      • eslint-config-prettier (dev) v^10.1.8
      • @typescript-eslint/parser (dev) v^8.40.0
      ... and 12 more

   🐳 Docker Infrastructure Analysis:
      🏗️  Orchestration Pattern: SingleContainer
         Simple containerized application
   🎯 Project Type: FunctionApp

📋 ANALYSIS SUMMARY
================================================================================
✅ Project Analysis Complete!

📈 Analysis Metadata:
   • Duration: 103ms
   • Files analyzed: 19
   • Confidence score: 93.2%
   • Analyzer version: 0.18.5

Remarks

  • Running cargo test results in 4 failing tests that does not appear to be caused by my changes (see output below)
  • I have formatted the files I have changed, but the formatter returns hundreds of warnings across the project
  • The cargo audit command does not exist when following the CONTRIBUTING guideline to setup the project tools (Disclaimer: I'm not used to working with Rust)

Failing tests output

failures:

---- analyzer::docker_analyzer::tests::test_extract_environment_from_filename stdout ----

thread 'analyzer::docker_analyzer::tests::test_extract_environment_from_filename' panicked at src/analyzer/docker_analyzer.rs:1184:9:
assertion `left == right` failed
  left: None
 right: Some("development")
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

---- analyzer::security::turbo::cache::tests::test_cache_eviction stdout ----

thread 'analyzer::security::turbo::cache::tests::test_cache_eviction' panicked at src/analyzer/security/turbo/cache.rs:349:9:
assertion failed: stats.entries < 1000

---- analyzer::security::turbo::pattern_engine::tests::test_pattern_matching stdout ----

thread 'analyzer::security::turbo::pattern_engine::tests::test_pattern_matching' panicked at src/analyzer/security/turbo/pattern_engine.rs:1013:9:
assertion failed: !matches.is_empty()

---- analyzer::security::turbo::tests::test_scan_modes stdout ----

thread 'analyzer::security::turbo::tests::test_scan_modes' panicked at src/analyzer/security/turbo/mod.rs:388:9:
assertion failed: report.total_findings > 0


failures:
    analyzer::docker_analyzer::tests::test_extract_environment_from_filename
    analyzer::security::turbo::cache::tests::test_cache_eviction
    analyzer::security::turbo::pattern_engine::tests::test_pattern_matching
    analyzer::security::turbo::tests::test_scan_modes

test result: FAILED. 80 passed; 4 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.28s

],
is_primary_indicator: true,
alternative_names: vec!["azure-functions".to_string()],
file_indicators: vec!["host.json".to_string(), "local.settings.json".to_string(), "function.json".to_string()],
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At least for Python, local.settings.json and function.json aren't necessarily present in function apps with the v2 programming model. host.json should always be there, though.

In the case of container-based function apps, you could have a Dockerfile, so not sure it makes sense to add that as an indicator

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants